package com.example.administrator.soccer;

import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class LoginActivity extends AppCompatActivity {
    Button mBtnLogin;
    EditText mEtUsername;
    EditText mEtPassword;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);

        initView();
        initEvent();


    }

    private void initEvent() {
        mBtnLogin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String username = mEtUsername.getText().toString();

                if (username.equals("admin")){
                    Intent intent = new Intent(LoginActivity.this, TeamsActivity.class);
                    startActivity(intent);
                }else {

                }
            }
        });
    }

    private void initView() {
        mBtnLogin = findViewById(R.id.btn_login);
        mEtUsername = findViewById(R.id.et_password);
        mEtPassword = findViewById(R.id.et_password);

    }

}
